#include "te_local.h"

namespace og
{
	namespace User
	{
		bool IsPakFileAllowed(PakFile *file)
		{
			// TODO: restrict specific PAK files
			return true;
		}

		void Error( ErrorId id, const char *msg, const char *param ) {
			// Todo: Throw an exception on the id's you think are important.
			String error;
			CreateErrorString( id, msg, param, error );
			ErrorDialog( error.c_str(), GAME_NAME );
		}

		void Warning( const char *msg ) {
			Console::Print( Format("WARNING: $*\n") << msg );
			//og::MessageDialog( Format("Warning: $*") << msg, GAME_NAME );
		}

		void AssertFailed( const char *code, const char *function ) {
			og::ErrorDialog( Format("Assert($*) failed in $*!") << code << function, GAME_NAME );
		}

		void OnConsoleMenuOpen( void( *callback )( const char *name, const char *command ) ) {
			callback( "List All Commands", "listcmds" );
			callback( "List All CVars", "listcvars" );
			callback( "Restart Renderer", "vid_restart" );
		}

		void OnForceExit( void ) {
			GameEngine::GetSingleton()->KillGameInstance();
		}
	}
}